package com.jefe.bamboo.service.service.base;

import com.jefe.bamboo.service.model.UserPrefsBmb;
import com.jefe.bamboo.service.service.UserPrefsBmbLocalService;
import com.jefe.bamboo.service.service.UserPrefsBmbService;
import com.jefe.bamboo.service.service.persistence.UserPrefsBmbPersistence;

import com.liferay.portal.PortalException;
import com.liferay.portal.SystemException;
import com.liferay.portal.kernel.annotation.BeanReference;
import com.liferay.portal.kernel.dao.orm.DynamicQuery;
import com.liferay.portal.util.PortalUtil;

import java.util.List;


public abstract class UserPrefsBmbLocalServiceBaseImpl
    implements UserPrefsBmbLocalService {
    @BeanReference(name = "com.jefe.bamboo.service.service.UserPrefsBmbLocalService.impl")
    protected UserPrefsBmbLocalService userPrefsBmbLocalService;
    @BeanReference(name = "com.jefe.bamboo.service.service.UserPrefsBmbService.impl")
    protected UserPrefsBmbService userPrefsBmbService;
    @BeanReference(name = "com.jefe.bamboo.service.service.persistence.UserPrefsBmbPersistence.impl")
    protected UserPrefsBmbPersistence userPrefsBmbPersistence;

    public UserPrefsBmb addUserPrefsBmb(UserPrefsBmb userPrefsBmb)
        throws SystemException {
        userPrefsBmb.setNew(true);

        return userPrefsBmbPersistence.update(userPrefsBmb, false);
    }

    public UserPrefsBmb createUserPrefsBmb(long bmbId) {
        return userPrefsBmbPersistence.create(bmbId);
    }

    public void deleteUserPrefsBmb(long bmbId)
        throws PortalException, SystemException {
        userPrefsBmbPersistence.remove(bmbId);
    }

    public void deleteUserPrefsBmb(UserPrefsBmb userPrefsBmb)
        throws SystemException {
        userPrefsBmbPersistence.remove(userPrefsBmb);
    }

    public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
        throws SystemException {
        return userPrefsBmbPersistence.findWithDynamicQuery(dynamicQuery);
    }

    public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
        int end) throws SystemException {
        return userPrefsBmbPersistence.findWithDynamicQuery(dynamicQuery,
            start, end);
    }

    public UserPrefsBmb getUserPrefsBmb(long bmbId)
        throws PortalException, SystemException {
        return userPrefsBmbPersistence.findByPrimaryKey(bmbId);
    }

    public List<UserPrefsBmb> getUserPrefsBmbs(int start, int end)
        throws SystemException {
        return userPrefsBmbPersistence.findAll(start, end);
    }

    public int getUserPrefsBmbsCount() throws SystemException {
        return userPrefsBmbPersistence.countAll();
    }

    public UserPrefsBmb updateUserPrefsBmb(UserPrefsBmb userPrefsBmb)
        throws SystemException {
        userPrefsBmb.setNew(false);

        return userPrefsBmbPersistence.update(userPrefsBmb, true);
    }

    public UserPrefsBmb updateUserPrefsBmb(UserPrefsBmb userPrefsBmb,
        boolean merge) throws SystemException {
        userPrefsBmb.setNew(false);

        return userPrefsBmbPersistence.update(userPrefsBmb, merge);
    }

    public UserPrefsBmbLocalService getUserPrefsBmbLocalService() {
        return userPrefsBmbLocalService;
    }

    public void setUserPrefsBmbLocalService(
        UserPrefsBmbLocalService userPrefsBmbLocalService) {
        this.userPrefsBmbLocalService = userPrefsBmbLocalService;
    }

    public UserPrefsBmbService getUserPrefsBmbService() {
        return userPrefsBmbService;
    }

    public void setUserPrefsBmbService(UserPrefsBmbService userPrefsBmbService) {
        this.userPrefsBmbService = userPrefsBmbService;
    }

    public UserPrefsBmbPersistence getUserPrefsBmbPersistence() {
        return userPrefsBmbPersistence;
    }

    public void setUserPrefsBmbPersistence(
        UserPrefsBmbPersistence userPrefsBmbPersistence) {
        this.userPrefsBmbPersistence = userPrefsBmbPersistence;
    }

    protected void runSQL(String sql) throws SystemException {
        try {
            PortalUtil.runSQL(sql);
        } catch (Exception e) {
            throw new SystemException(e);
        }
    }
}
